<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUserAuthsTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::create('user_auths', function (Blueprint $table) {
            $table->id();
            $table->timestamps();
            $table->string('user_id')->unique()->comment('用户ID');
            $table->string('real_name', 32)->comment('真实姓名');
            $table->string('id_card', 18)->comment('身份证号');
            $table->string('id_card_front_image', 256)->comment('身份证下面照');
            $table->string('id_card_back_image', 256)->comment('身份证背面照');
            $table->string('province', 32)->comment('省');
            $table->string('city', 32)->comment('市');
            $table->string('district', 32)->comment('区');
            $table->string('address', 256)->comment('详细地址');
            $table->string('bank_code', 32)->comment('开户行编码');
            $table->string('bank_card_no', 32)->comment('银行卡号');
            $table->string('bank_card_mobile', 18)->comment('银行卡预留手机号');
            $table->string('audit_status', 16)->default(\App\Enums\AuditStatus::WAITING)->comment('实名认证审核状态');
            $table->string('yeepay_request_no', 32)->default('')->index()->comment('易宝小微商户认证请求编号');
            $table->string('merchant_no', 32)->nullable()->comment('个人分账商户号');
            $table->string('reject_reason', 256)->comment('审核拒绝原因');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('user_auths');
    }
}
